#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int a, b;
	int num1 = 0;
	int num2 = 0;
	scanf("%d %d", &a, &b);
	while (a != 0)
	{
		num1 = a % 2;
		a = a / 2;
		printf("%ld", num1);
	}
	printf("\n");
	while (b != 0)
	{
		num2 = b % 2;
		b = b / 2;
		printf("%ld", num2);
	}
	printf("\n");
	return 0;
}